<?= $this->doctype() ?>
<html>
<head>
    
    <?php
        // Here we setup the default js and css, pages that need special link should do so by suing the 
        // view helpers: headLink appendStylesheet or headScript appendFile
        $baseUrl = $this->baseUrl();
    
        // Style sheets
        $this->headLink()->appendStylesheet($baseUrl . 'css/site.css');
        $this->headLink()->appendStylesheet($baseUrl . 'css/frames.css');
        $this->headLink()->appendStylesheet($baseUrl . 'css/form.css');
        $this->headLink()->appendStylesheet($baseUrl . 'css/input.css');
        $this->headLink()->appendStylesheet($baseUrl . 'css/shaded.css');
        
        $this->headScript()->appendFile($baseUrl . 'js/common.js', 'text/javascript');
    ?>
    
    <?= $this->jQuery() ?>
	<?= $this->headMeta() ?> 
    <?= $this->headTitle() ?> 
    <?= $this->headScript() ?> 
    <?= $this->headStyle() ?> 
    <?= $this->headLink() ?>
       
</head>
<body>
    
    <?php if (APPLICATION_ENV == 'development') : ?>
    
    <!--  
    <div style='background-color: red; text-align: center; padding: 10px;'>
        APPLICATION_ENV: development
    </div>  
    -->
    
    <?php endif; ?>

    <div id="page-navigation">
        <div class="navigation-top"></div>
        <div class="navigation-middle">
            
            <?= $this->navigation()->menu()->renderMenu(null, array('ulClass' => '', 'maxDepth' => 0)) ?>
            
            <ul>
                <?php if (Zend_Auth::getInstance()->hasIdentity()) : ?>
                <li><a href="<?= $this->url(array('module' => 'default', 'controller' => 'authentication', 'action' => 'logout'), null, true) ?>">Logout</a></li>
                <?php else : ?>
                <li><a href="<?= $this->url(array('module' => 'default', 'controller' => 'authentication', 'action' => 'login'), null, true) ?>">Login</a></li>
                <?php endif; ?>
            </ul>
            
        </div>
        <div class="navigation-bottom"></div>
        <div class="navigation-shadow">
        
            <script type="text/javascript">
            $(document).ready(function() {
                if ($.trim($("#page-sub-navigation").html()) != '') {
                    $("#page-sub-navigation").show();
                }
            });              
            </script>
                
            <div id="page-sub-navigation" style="display: none">
                <?= $this->navigation()->menu()->renderMenu(null, array('ulClass' => '', 'renderParents' => false, 'minDepth' => 1,  'maxDepth' => 1, 'onlyActiveBranch' => true)); ?>
            </div>
        </div>
    </div>
    
    <div id="page-layout">
    
        <div id="page-top">
            <?php if (rand(1,10) == 10) : ?>
            <?= $this->img('/gfx/site/staffy.png') ?>
            <?php else: ?>
            <?= $this->img('/gfx/site/phoenix.png') ?>
            <?php endif; ?>
        </div>
        
        <div id="page-middle">
        
            <div id="page-center">
            
                <?php if ($this->flashMessage) : ?>
                <div class="flash-message content-full">
                    <h2><?= $this->flashMessage; ?></h2>
                </div>
                <?php endif; ?>
                
                <?= $this->layout()->content; ?>
            </div>
            
        </div>
        
        <div id="page-bottom">
        </div>
        
    </div>

</body>
</html>